<template>
  <!-- <img src="" alt="" ref="imgRef" @click="imagePreview"/> -->
  
  <img src="" alt="" ref="imgRef" @click="$router.push('/poster/' +
                    $store.state.userInfo.F_Question+'/' +
                    $store.state.userInfo.F_Account)"/> 
</template>
<script>
import { ref } from "vue";
import QRCode from "qrcode";
import { useStore } from "vuex";
import { ImagePreview } from 'vant';
export default {
  setup() {
    const imgRef = ref(null);
    const store = useStore();
    const qrurl =
      "http://www.higuang365.com/index.php/wap/passport-signup.html?parents_id=" +
      store.state.userInfo.F_Question;

    const qr = () => {
      QRCode.toDataURL(qrurl || "http://www.higuang365.com/index.php/wap").then(
        (url) => imgRef.value && (imgRef.value.src = url)
      );
      
    };
    const imagePreview=()=>{
          ImagePreview([imgRef.value.src])
      }
    qr();
    return { imgRef,imagePreview };
  },
};
</script>